<link rel="Stylesheet" type="text/css" href="<?php echo $base_url ?>style/css/jquery.jmodal.css" />
<script language="javascript" src="<?php echo $base_url ?>style/js/BE/jquery.jmodal.js"></script>
<script>
    var js_url = "<?php echo $base_url; ?>";
    var link_page_name = "<?php echo $link_page_name; ?>";
    var js_pagetitle = "<?php echo $page_title ?>";
</script>
<script language="javascript" src="<?php echo $base_url; ?>style/js/BE/admin_news_auto.js"></script>
<br />

<!-- begin select date -->
<link rel="stylesheet" type="text/css" media="all" href="<?php echo $base_url ?>style/js/BE/datepicker/jsDatePick_ltr.min.css" />
<script type="text/javascript" src="<?php echo $base_url ?>style/js/BE/datepicker/jsDatePick.min.1.3.js"></script>
<!-- end   search -->
<div style="padding:12px; float: left">Danh sách <?php echo $page_title; ?>:</div>
<input type="button" value="Lấy Video" style="float: right;width: 110px;height: 30px;margin-right: 13px;" onclick="window.location.href='/admin_video/get_video';" />
<div id="div_ajax_content" style="padding:0; margin:0;">
    <?php
    if ($videoCount > 0) {
        ?>
        <table width="98%" border="0" cellpadding="0" cellspacing="1" bgcolor="#3D84CC" style="margin:auto; line-height:20px;">
            <tbody><tr>
                    <td width="10%" align="center" bgcolor="#3D84CC" class="title1">STT</td>
                    <td width="45%" align="center" bgcolor="#3D84CC" class="title1">Tiêu đề</td>
                    <td width="40%" align="center" bgcolor="#3D84CC" class="title1">Link video</td> 
                    <td width="5%" align="center" bgcolor="#3D84CC" class="title1">&nbsp;</td> 
                </tr>  
                <?php
                $i = 1;
                $bgcolor = "#FFFFFF";
                foreach ($aVideos as $key => $item) :
                    if ($i % 2 == 0) {
                        $bgcolor = "#EBF2F8";
                    } else {
                        $bgcolor = "#FFFFFF";
                    }
                    ?>  
                    <tr bgcolor="<?php echo $bgcolor; ?>">
                        <td align="center" class="index" valign="top"><?php echo ($cur_page - 1) * PAGESIZE + $i; ?></td>
                        <td align="center" class="content" style="text-align:left;" valign="top">
                            <?php echo $item->title; ?><br>
                        </td>     
                        <td class="content" style="text-align:center;" valign="top">
                            <a href="https://www.youtube.com/watch?v=<?php echo $item->link; ?>" target="_blank">https://www.youtube.com/watch?v=<?php echo $item->link; ?></a>
                        </td>
                        <td class="content" style="text-align:center;" valign="top">
                            <a href="/admin_video/delete/<?php echo $item->video_id; ?>">Xóa video</a>
                        </td>
                    </tr>  
                    <?php
                    $i++;
                endforeach;
                ?> 
            </tbody>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
                <td style="text-align:center; font-size: 18px;">
                    <?php echo $paging; ?>     
                </td>
            </tr>
        </table>
        <?php
    } else {
        ?>
        <table width="98%" border="0" cellpadding="0" cellspacing="1" style="margin:auto;">
            <tr>
                <td style="text-align:center;" height="60px">Không tìm thấy thông tin.</td>
            </tr>
        </table>  
        <?php
    }
    ?>
    <input type="hidden" id="h_cur_page" value="">
    <input type="hidden" id="h_Search" value="$search">
</div>